﻿<%@ Page Title="" Language="C#" MasterPageFile="~/indexmaster.Master" AutoEventWireup="true" CodeBehind="UserInformation.aspx.cs" Inherits="Web_Demo.UserInformation" %>
<%@ Register assembly="obout_Grid_NET" namespace="Obout.Grid" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="content2">              
					<div class="post">
                        <h2 class="title">
                            <a href="#">User Information </a>
                        </h2>
    <cc1:Grid ID="Grid1" runat="server" AllowAddingRecords="False" 
        DataSourceID="SqlDataSource1" AllowMultiRecordDeleting="True" 
        AllowMultiRecordEditing="True" AllowMultiRecordSelection="False" 
    Width="400px" AutoGenerateColumns="False" ExportedFilesTargetWindow="Current" 
    FilterType="Normal">
         <Columns>
                    <cc1:Column ID="Column1" DataField="ID_User" Width="100" ReadOnly="true" HeaderText="UserID" runat="server" />
                    <cc1:Column ID="Column2" DataField="Name_User" Width="150" HeaderText="USERNAME" runat="server" />
                    <cc1:Column ID="Column3" DataField="First_Name"  Width="125" HeaderText="FIRSTNAME" runat="server" />
                    <cc1:Column ID="Column4" DataField="Last_Name" Width="150" HeaderText="LASTNAME" runat="server" />
                    <cc1:Column ID="Column5" DataField="Email" Width="150" HeaderText="EMAIL" runat="server" />
                    <cc1:Column ID="Column6" DataField="ID_Role_User" Width="100" HeaderText="ROLE" runat="server" />
                    <cc1:Column ID="Column7" DataField="CreatedOndate" Visible ="false" Width="125" 
                        ReadOnly="true" HeaderText="Createondate" runat="server" />
                    <cc1:Column AllowEdit="true" AllowDelete="true" HeaderText="Edit" Width="150"  />
        </Columns>
    </cc1:Grid>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DMS_DEMOConnectionString3 %>" 
        DeleteCommand="DELETE FROM [DMS_User] WHERE [ID_User] = @ID_User" 
        InsertCommand="INSERT INTO [DMS_User] ([Name_User], [First_Name], [Last_Name], [Email], [ID_Role_User], [CreatedOndate]) VALUES (@Name_User, @First_Name, @Last_Name, @Email, @ID_Role_User, @CreatedOndate)" 
        SelectCommand="SELECT [ID_User], [Name_User], [First_Name], [Last_Name], [Email], [ID_Role_User], [CreatedOndate] FROM [DMS_User]" 
        UpdateCommand="UPDATE [DMS_User] SET [Name_User] = @Name_User, [First_Name] = @First_Name, [Last_Name] = @Last_Name, [Email] = @Email, [ID_Role_User] = @ID_Role_User WHERE [ID_User] = @ID_User">
        <DeleteParameters>
            <asp:Parameter Name="ID_User" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Name_User" Type="String" />
            <asp:Parameter Name="First_Name" Type="String" />
            <asp:Parameter Name="Last_Name" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="ID_Role_User" Type="Int32" />
            <asp:Parameter Name="CreatedOndate" Type="DateTime" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="Name_User" Type="String" />
            <asp:Parameter Name="First_Name" Type="String" />
            <asp:Parameter Name="Last_Name" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="ID_Role_User" Type="Int32" />
            <asp:Parameter Name="ID_User" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
    </div>
    </div>
</asp:Content>
